<?php
/**
 * Created by PhpStorm.
 * User: DaibiDaddy
 * Date: 2016/6/3
 * Time: 14:59
 */

namespace App\Setting;

use Doctrine\Persistence\ManagerRegistry;
use App\Base\BaseForm;
use App\Base\ViewsInList;

class SarsUserSetting{

    /*手动获取的配置项*/
    public $catType = "admin";//Options:level snake
    public $entityCnName = "河口区疫情处置人员信息";//模块名称
    public $table = "SarsUser";//数据表名称
    public $editKeys = array('id','dengjileibie','zhongdianyiqumingcheng','xingming','xingbie','shenfenzhenghao','lianxidianhua','gongzuodanwei','xiangxizhuzhi','fangwuleixing','likairiqi','likaidiquzhuzhi','jinruhekouriqi','laihekoumudi','wangfanxiangxixingcheng','yantushifoutingliu','tongxingrenyuan','miqiejiechurenyuan','tiwen','bushizhengzhuang','geliguancha','gelifangshi','jiechugeli','zerenren','suifangyuan','suifangjibie','zhongdiansuifangyuanyin','renyuanxinxilaiyuan','dengjiriqi');//后台管理列表中可以直接编辑的字段
    public $perPage = 10;//后台管理列表中可以直接编辑的字段
    public $noDelete = [];//不想允许删除的ID 放在这里面[0]表示全部禁止删除

    /*自动获取的配置项*/
    public $bundleName;
    public $entityName;
    public $SettingPath;
    public $entityPath;
    public $entity;
    public $modelPath;
    public $doctrine;
    public $em;

    public function __construct(ManagerRegistry $doctrine)
    {
        $this->bundleName = "App";
        $this->entityName = str_replace("\\","",str_replace("Setting","",str_replace(__NAMESPACE__,"",__CLASS__)));
        $this->SettingPath = __CLASS__;
        //$this->entityPath = str_replace($this->entityName."Entity",$this->entityName,str_replace("Setting","Entity",__CLASS__));
        $this->entityPath = "App\\Entity\\".$this->entityName;
        $this->entity = new $this->entityPath();
        $this->modelPath = str_replace("Setting","Model",__CLASS__);
        $this->doctrine = $doctrine;
        $this->em = $doctrine->getManager();
    }

    public function listConfig()
    {
        $default = array();
        $default["SarsUser"]["select"] = array('id','dengjileibie','zhongdianyiqumingcheng','xingming','xingbie','shenfenzhenghao','lianxidianhua','gongzuodanwei','xiangxizhuzhi','fangwuleixing','likairiqi','likaidiquzhuzhi','jinruhekouriqi','laihekoumudi','wangfanxiangxixingcheng','yantushifoutingliu','tongxingrenyuan','miqiejiechurenyuan','tiwen','bushizhengzhuang','geliguancha','gelifangshi','jiechugeli','zerenren','suifangyuan','suifangjibie','zhongdiansuifangyuanyin','renyuanxinxilaiyuan','dengjiriqi');
        $default["SarsUser"]["search"] = array('id','dengjileibie','zhongdianyiqumingcheng','xingming','xingbie','shenfenzhenghao','lianxidianhua','gongzuodanwei','xiangxizhuzhi','fangwuleixing','likairiqi','likaidiquzhuzhi','jinruhekouriqi','laihekoumudi','wangfanxiangxixingcheng','yantushifoutingliu','tongxingrenyuan','miqiejiechurenyuan','tiwen','bushizhengzhuang','geliguancha','gelifangshi','jiechugeli','zerenren','suifangyuan','suifangjibie','zhongdiansuifangyuanyin','renyuanxinxilaiyuan','dengjiriqi');
        $default["SarsUser"]["condition"] = array('id','dengjileibie','zhongdianyiqumingcheng','xingming','xingbie','shenfenzhenghao','lianxidianhua','gongzuodanwei','xiangxizhuzhi','fangwuleixing','likairiqi','likaidiquzhuzhi','jinruhekouriqi','laihekoumudi','wangfanxiangxixingcheng','yantushifoutingliu','tongxingrenyuan','miqiejiechurenyuan','tiwen','bushizhengzhuang','geliguancha','gelifangshi','jiechugeli','zerenren','suifangyuan','suifangjibie','zhongdiansuifangyuanyin','renyuanxinxilaiyuan','dengjiriqi',"createBy");
        $default["SarsUser"]["orderBy"] = array("id"=>"DESC");

        $join = array();
//        $join["SarsUserCategory"]["on"] = "";
//        $join["SarsUserCategory"]["select"] = array();
//        $join["SarsUserCategory"]["search"] = array();
//        $join["SarsUserCategory"]["condition"] = array();
//        $join["SarsUserCategory"]["orderBy"] = array();

        return array(
            "default"   => $default,
            "joins"     => $join,
        );
    }

    public function viewConfig()
    {

    }


    public function formUploadConfig()
    {
        $BaseForm = new BaseForm();
        $config["file"] = $BaseForm->file("file","文件");
        return $config;
    }

    public function formConfig()
    {
        $BaseForm = new BaseForm();
        $config["xingming"] = $BaseForm->text("xingming","姓名")->setWidth(3);
        $config["lianxidianhua"] = $BaseForm->text("lianxidianhua","联系方式")->setWidth(3);
        $config["shenfenzhenghao"] = $BaseForm->text("shenfenzhenghao","身份证号")->setWidth(3);
        $config["xiangxizhuzhi"] = $BaseForm->text("xiangxizhuzhi","家庭住址")->setWidth(8);
        $config["tiwen"] = $BaseForm->text("tiwen","体温")->setWidth(4);
//        $config["gongzuodanwei"] = $BaseForm->text("gongzuodanwei","工作单位")->setWidth(4);
        $config["bushizhengzhuang"] = $BaseForm->text("bushizhengzhuang","有无咳嗽、胸闷等不适症状")->setWidth(8);
        $config["likaidiquzhuzhi"] = $BaseForm->text("likaidiquzhuzhi","在外居住地（酒店名称、地址）")->setWidth(8);
        $config["likairiqi"] = $BaseForm->date("likairiqi","回来时间")->setWidth(4);
        $config["yantushifoutingliu"] = $BaseForm->text("yantushifoutingliu","车次/航班/汽车/自驾")->setWidth(8);
        $config["wangfanxiangxixingcheng"] = $BaseForm->text("wangfanxiangxixingcheng","往返行程详细说明")->setWidth(8);
        $data["gelifangshi"] = ["集中隔离", "医院留观", "居家隔离"];
        $config["gelifangshi"] = $BaseForm->selectinput("gelifangshi","管控措施（居家隔离、集中隔离、医院留观）",$data["gelifangshi"])->setWidth(4);
        $config["suifangyuan"] = $BaseForm->text("suifangyuan","随访人员（姓名+联系方式）")->setWidth(4);
        $config["jiechugeli"] = $BaseForm->date("jiechugeli","脱离潜伏期日期")->setWidth(4);
        $config["geliguancha"] = $BaseForm->text("geliguancha","是否脱离隔离期")->setWidth(4);
        $config["zhongdiansuifangyuanyin"] = $BaseForm->textarea("zhongdiansuifangyuanyin","备注")->setWidth(12);
        return $config;
    }
    public function formConfigOld()
    {
        $BaseForm = new BaseForm();
        $config["zhongdianyiqumingcheng"] = $BaseForm->text("zhongdianyiqumingcheng","重点疫区名称")->setWidth(8);
        $data["dengjileibie"] = [
            "来自重点疫区",
            "发热及其他不适症状",
            "密切接触者",
            "行程复杂"
        ];
        $config["dengjileibie"] = $BaseForm->selectinput("dengjileibie","登记类别",$data["dengjileibie"] )->setWidth(4);
        $config["xingming"] = $BaseForm->text("xingming","姓名")->setWidth(3);

        $config["xingbie"] = $BaseForm->select("xingbie","性别",["男","女"])->setText()->setWidth(3);
        $config["shenfenzhenghao"] = $BaseForm->text("shenfenzhenghao","身份证号")->setWidth(3);
        $config["lianxidianhua"] = $BaseForm->text("lianxidianhua","联系电话")->setWidth(3);
        $config["gongzuodanwei"] = $BaseForm->text("gongzuodanwei","工作单位")->setWidth(4);
        $config["xiangxizhuzhi"] = $BaseForm->text("xiangxizhuzhi","目前详细居住地址")->setWidth(8);
        $data["fangwuleixing"] = [
            "自有",
            "租住"
        ];
        $config["fangwuleixing"] = $BaseForm->select("fangwuleixing","房屋类型",$data["fangwuleixing"])->setText()->setWidth(4);
        $config["likairiqi"] = $BaseForm->datetime("likairiqi","离开日期")->setWidth(4);
        $config["likaidiquzhuzhi"] = $BaseForm->text("likaidiquzhuzhi","离开地区住址")->setWidth(4);
        $config["jinruhekouriqi"] = $BaseForm->datetime("jinruhekouriqi","进入河口日期")->setWidth(4);

        $data["laihekoumudi"] = [
            "复工",
            "回家",
            "探亲",
            "个体经营"
        ];
        $config["laihekoumudi"] = $BaseForm->selectinput("laihekoumudi","来河口目的",$data["laihekoumudi"])->setWidth(4);

        $config["wangfanxiangxixingcheng"] = $BaseForm->text("wangfanxiangxixingcheng","往返详细行程（车次/航班/汽车/自驾）")->setWidth(4);
        $config["yantushifoutingliu"] = $BaseForm->text("yantushifoutingliu","沿途是否停留（停留地点）")->setWidth(4);
        $config["tongxingrenyuan"] = $BaseForm->text("tongxingrenyuan","同行人员")->setWidth(4);
        $config["miqiejiechurenyuan"] = $BaseForm->text("miqiejiechurenyuan","密切接触人员")->setWidth(4);
        $config["tiwen"] = $BaseForm->text("tiwen","登记时体温")->setWidth(4);
        $config["bushizhengzhuang"] = $BaseForm->text("bushizhengzhuang","有无咳嗽、胸闷等不适症状")->setWidth(4);
        $config["geliguancha"] = $BaseForm->text("geliguancha","是否隔离观察")->setWidth(4);


        $data["gelifangshi"] = [
            "集中隔离,从2020年X月X日起至从2020年X月X日",
            "医院留观,从2020年X月X日起至从2020年X月X日",
            "居家隔离,从2020年X月X日起至从2020年X月X日"
        ];
        $config["gelifangshi"] = $BaseForm->selectinput("gelifangshi","隔离方式",$data["gelifangshi"])->setWidth(4);

        $data["jiechugeli"] = [
            "未解除隔离，隔离时间从2020年X月X日起至从2020年X月X日",
            "已解除隔离，解除时间2020年X月X日"
        ];
        $config["jiechugeli"] = $BaseForm->selectinput("jiechugeli","是否解除隔离",$data["jiechugeli"])->setWidth(4);
        $config["zerenren"] = $BaseForm->text("zerenren","责任人")->setWidth(4);
        $config["suifangyuan"] = $BaseForm->text("suifangyuan","随访员")->setWidth(4);

        $data["suifangjibie"] = [
            "一般",
            "重点"
        ];
        $config["suifangjibie"] = $BaseForm->select("suifangjibie","随访级别", $data["suifangjibie"])->setText()->setWidth(4);


        $data["zhongdiansuifangyuanyin"] = [
            "来自重点疫区未脱离潜伏期",
            "发热及其他不适症状",
            "密切接触者未脱离潜伏期",
            "行程复杂未脱离潜伏期"
        ];
        $config["zhongdiansuifangyuanyin"] = $BaseForm->selectinput("zhongdiansuifangyuanyin","重点随访原因",$data["zhongdiansuifangyuanyin"] )->setWidth(4);

        $data["renyuanxinxilaiyuan"] = [
            "网格摸排",
            "主动报备",
            "车站推送",
            "医院推送",
            "群众举报",
            "公安推送",
            "学校推送",
        ];
        $config["renyuanxinxilaiyuan"] = $BaseForm->selectinput("renyuanxinxilaiyuan","人员信息来源", $data["renyuanxinxilaiyuan"])->setWidth(4);
        $config["dengjiriqi"] = $BaseForm->datetime("dengjiriqi","登记日期")->setWidth(4);
        return $config;
    }
}